gtkwindow: Consistently set the style classes for window-frame
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 27 Aug 2013 19:35:46 +0000 (15:35 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 28 Aug 2013 14:33:57 +0000 (10:33 -0400)
In one place, we forgot to remove the BACKGROUND style class before
adding window-frame. Add a helper method so these are all the same.

https://bugzilla.gnome.org/show_bug.cgi?id=706922

gtk/gtkwindow.c

index 434b2fee1f06e7235369281ffdde35663ae1fc10..55e508807a4465af4c7a11cceee327e07fcfc024 100644 (file)
@@ -6192,6 +6192,13 @@ sum_borders (GtkBorder *one,
   one->left += two->left;
 }
 
+static void
+add_window_frame_style_class (GtkStyleContext *context)
+{
+  gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND);
+  gtk_style_context_add_class (context, "window-frame");
+}
+
 static void
 get_decoration_size (GtkWidget *widget,
                      GtkBorder *decorations)
@@ -6217,8 +6224,7 @@ get_decoration_size (GtkWidget *widget,
   context = gtk_widget_get_style_context (widget);
 
   gtk_style_context_save (context);
-  gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND);
-  gtk_style_context_add_class (context, "window-frame");
+  add_window_frame_style_class (context);
 
   /* Always sum border + padding */
   gtk_style_context_get_border (context, state, decorations);
@@ -6260,7 +6266,7 @@ update_border_windows (GtkWindow *window)
 
   context = gtk_widget_get_style_context (widget);
   gtk_style_context_save (context);
-  gtk_style_context_add_class (context, "window-frame");
+  add_window_frame_style_class (context);
   gtk_style_context_get_margin (context,
                                 gtk_widget_get_state_flags (widget),
                                 &border);
@@ -9150,8 +9156,7 @@ gtk_window_draw (GtkWidget *widget,
         {
           gtk_style_context_save (context);
 
-          gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND);
-          gtk_style_context_add_class (context, "window-frame");
+          add_window_frame_style_class (context);
 
           gtk_render_background (context, cr,
                                  window_border.left, window_border.top,